#include<stdio.h>
#include <stdlib.h>

int compare(const void* a, const void* b) 
{
    return **(int**)a - **(int**)b;
}

int main()
{
    int in_num, sum_num = 0;
    scanf("%d", &in_num);
    int* arr = (int*)malloc(in_num * sizeof(int));
    int* arr1 = (int*)malloc(in_num * sizeof(int));
    int** dir = (int**)malloc(sizeof(int*) * in_num);

    if (arr == NULL || dir == NULL || arr1 == NULL) 
    {
        printf("Memory allocation failed");
        return 1;
    }

    for (int i = 0; i < in_num; i++) 
    {
        scanf("%d", &arr[i]);
        dir[i] = &arr[i];
        sum_num += arr[i];
    }

    int average = sum_num * 2 / in_num;
    int judge1 = sum_num  * 2 % in_num ; 
    if (judge1 != 0)
    {
        printf("-1");
        free(arr);free(arr1);free(dir);
        return 0;
    }

    qsort(dir, in_num, sizeof(int*), compare);

    for (int i = 0; i < in_num/2 + 1; i++)
    {   
        if (*dir[i] + *dir[in_num-1-i] == average)
        {
            arr1[dir[i] - arr] = dir[in_num-i-1] - arr + 1; 
            arr1[dir[in_num-i-1] - arr] = dir[i] - arr + 1;
        }else{
            free(arr);free(arr1);free(dir);
            printf("-1");
            return 0;
        }
    }

    for (int i = 0; i < in_num; i++)
    {
        printf("%d ", arr1[i]);
    }
    
    free(arr);free(arr1);free(dir);
    return 0;
}
